//
//  ChildView.swift
//  fsapp
//
//  Created by zguang on 17/7/29.
//  Copyright © 2017年 huangshengjie. All rights reserved.
//

import Foundation
import UIKit

class ChildView{
   
    init(type:String) {
       if(type == "fill")
       {
        headerView.addSubview(self.moneySort)
        headerView.addSubview(self.timeSort)
        headerView.addSubview(self.countSort)
        }
    }
    
    
    
    
    lazy var headerView:UIView = {
        let view = UIView(frame:CGRect(x:0,y:0,width:SCREEN_WIDTH,height:getHeight(65*2)))
        view.backgroundColor = UIColor.white
        return view
    }()
    
    
    lazy var moneySort:UIButton = {
        let button = UIButton(frame:CGRect(x:getWidth(width: 70),y:getHeight(0),width:getWidth(width: 48*2+10),height:getHeight(65)))
        
        button.setTitle("价格", for: .normal)
        button.titleLabel?.font = UIFont.systemFont(ofSize: height(28))
        button.setTitleColor(UIColor.gray, for: .normal)
        button.setTitleColor(UIColor.blue, for: .selected)
        button.setImage(#imageLiteral(resourceName: "三角"), for: .normal)
        button.setImage(#imageLiteral(resourceName: "三角-蓝"), for: .selected)
        button.titleEdgeInsets = UIEdgeInsets.init(top: 0, left:0, bottom: 0, right: width(18))
        button.imageEdgeInsets = UIEdgeInsets.init(top: 0, left: width(83), bottom: 0, right: width(0))
        
        return button
    }()
    
    lazy var timeSort:UIButton = {
        let button = UIButton(frame:CGRect(x:getWidth(width: 318),y:getHeight(0),width:getWidth(width: 48*2+10),height:getHeight(65)))
        button.setTitle("时长", for: .normal)
         button.titleLabel?.font = UIFont.systemFont(ofSize: height(28))
        button.setTitleColor(UIColor.gray, for: .normal)
        button.setTitleColor(UIColor.blue, for: .selected)
        button.titleEdgeInsets = UIEdgeInsets.init(top: 0, left:0, bottom: 0, right: width(18))
        button.setImage(#imageLiteral(resourceName: "三角"), for: .normal)
        button.setImage(#imageLiteral(resourceName: "三角-蓝"), for: .selected)
        button.imageEdgeInsets = UIEdgeInsets.init(top: 0, left: width(83), bottom: 0, right: width(0))
        return button
        //338
    }()
    lazy var countSort:UIButton = {
        let button = UIButton(frame:CGRect(x:getWidth(width: 573),y:getHeight(0),width:getWidth(width: 48*3+20),height:getHeight(65)))
        button.setTitle("播放量", for: .normal)
         button.titleLabel?.font = UIFont.systemFont(ofSize: height(28))
        button.setTitleColor(UIColor.gray, for: .normal)
        button.setTitleColor(UIColor.blue, for: .selected)
        button.titleEdgeInsets = UIEdgeInsets.init(top: 0, left:0, bottom: 0, right: width(45))
        button.setImage(#imageLiteral(resourceName: "三角"), for: .normal)
        button.setImage(#imageLiteral(resourceName: "三角-蓝"), for: .selected)
        button.imageEdgeInsets = UIEdgeInsets.init(top: 0, left: width(115), bottom: 0, right: width(0))
        return button
    }()
    
    lazy var cellBackView:UIView = {
     let view = UIView(frame:CGRect(x:0,y:64,width:SCREEN_WIDTH,height:getHeight(400)))
        return view
    }()
    
    
    
    
    
}
